package protocol;

public class GameToConnect extends User {

//	public String ip;
	public int port;
//	public String name;
	String gameStyle;
	public long lastAnnouncement;

	public GameToConnect(String ip, int port, String name, String gameStyle) {
		super(ip, name);
//		this.ip = ip;
		this.port = port;
//		this.name = name;
		this.gameStyle = gameStyle;
		this.lastAnnouncement = System.currentTimeMillis();
	}

//	public boolean modify(String ip, int port, String name) {
//		boolean change = !this.ip.equals(ip) || this.port != port || !this.name.equals(name);
//		this.ip = ip;
//		this.port = port;
//		this.name = name;
//		this.lastAnnouncement = System.currentTimeMillis();
//		return change;
//	}
	
	public long lastConnection(long now) {
		return now - lastAnnouncement;
	}

//	public InetAddress getIp() {
//		return ip;
//	}

//	public void setIp(InetAddress ip) {
//		this.ip = ip;
//	}

//	public int getPort() {
//		return port;
//	}

//	public void setPort(int port) {
//		this.port = port;
//	}

//	public String getName() {
//		return name;
//	}
//	
//	public String getStyle() {
//		return gameStyle;
//	}

//	public void setName(String name) {
//		this.name = name;
//	}

	@Override
	public String toString() {
		return name+" ("+ip+":"+port+")";
	}

}
